import { MyRequestOptions,HttpResponse } from './type';
import request from '@/utils/api/request';

// 登录
export const userLogin = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/login`;
  return request.post(option);
};

// 手机号是否存在
export const userPhoneExist = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/phoneExist`;
  return request.get(option);
};

// 填写邀请码
export const fillShareCode = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/fillShareCode`;
  return request.post(option);
};

// 发送手机验证码
export const sendSmsCode = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/sendSmsCode`;
  return request.post(option);
};

// 忘记密码
export const forgetPassword = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/forgetPassword`;
  return request.post(option);
};

// 修改支付密码
export const setPayPwd = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/setPayPwd`;
  return request.post(option);
};


//查询协议
export const queryAgreement = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/queryAgreement`;
  return request.get(option);
};


export const getAgreementById = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/getAgreementById`;
  return request.get(option);
};



// 绑定手机号
export const completePhone = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/completePhone`;
  return request.post(option);
};

// 查询世界墙墙视图
export const queryUserTrends = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/queryUserTrends`;
  return request.post(option);
};

// 创建话题
export const saveSubject = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/saveSubject`;
  return request.post(option);
};

// 查询热门话题20个
export const queryHeatSubject = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/queryHeatSubject`;
  return request.post(option);
};

// 模糊查询返回前30条话题
export const querySubject = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/querySubject`;
  return request.post(option);
};

// 我的粉丝视图
export const queryMyCoverFollow = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/follow/queryMyCoverFollow`;
  return request.post(option);
};

// 发布/编辑墙墙
export const saveTrends = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/saveTrends`;
  return request.post(option);
};

// 墙墙点赞/取消
export const saveOrDleTrendsPraise = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/saveOrDleTrendsPraise`;
  return request.post(option);
};

// 关注或取消关注用户
export const saveFollow = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/follow/saveFollow`;
  return request.post(option);
};

// 查询墙墙评论
export const queryMyTrendsComments = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/queryMyTrendsComments`;
  return request.post(option);
};

// 评论回复
export const saveTrendsComments = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/saveTrendsComments`;
  return request.post(option);
};

// 评论点赞
export const saveTrendsCommentsPraise = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/saveTrendsCommentsPraise`;
  return request.post(option);
};

// 获取logUrl
export const getLogUrl = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/file/getLogUrl`;
  return request.get(option);
};

// 查询墙墙评论二级回复
export const queryMyTrendsReply = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/queryMyTrendsReply`;
  return request.post(option);
};

// 获取贴主的主页的所有信息
export const queryUserHome = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/queryUserHome`;
  return request.post(option);
};

// 查询墙墙详情信息
export const queryUserTrendsInfo = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/queryUserTrendsInfo`;
  return request.post(option);
};

// 礼物购买列表
export const listGiftConfig = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/listGiftConfig`;
  return request.get(option);
};

// 我的钱包查询
export const userWallet = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/userWallet`;
  return request.get(option);
};

// 墙墙礼物打赏
export const rewardTrendsGift = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/rewardTrendsGift`;
  return request.post(option);
};

// 我的钱包查询
export const listRechargeListDiamond = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/listRechargeListDiamond`;
  return request.get(option);
};

// 评论查询
export const queryCommentsById = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/queryCommentsById`;
  return request.post(option);
};

// 用户举报
export const saveReportInfo = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/report/saveReportInfo`;
  return request.post(option);
};

// 用户举报记录
export const getReportList = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/report/getReportList`;
  return request.post(option);
};

// 发红包
export const buyRedEnvelope = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/red/buyRedEnvelope`;
  return request.post(option);
};

// 红包记录
export const redEnvelopeList = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/red/redEnvelopeList`;
  return request.get(option);
};

// 查询当前头条
export const currentHeadline = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/red/currentHeadline`;
  return request.get(option);
};

// 发红包
export const upHeadline = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/red/upHeadline`;
  return request.post(option);
};

// 上头条
export const upPopular = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/red/upPopular`;
  return request.post(option);
};
// 上头条记录
export const headlineHistory = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/red/headlineHistory`;
  return request.get(option);
};

// 互关朋友列表
export const queryMyInterrelation = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/follow/queryMyInterrelation`;
  return request.post(option);
};


export const authenticationFlag = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/authenticationFlag`;
  return request.get(option);
};


export const delTrendsState = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/trends/delTrendsState`;
  return request.post(option);
};

export const rechargeDiamond = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/rechargeDiamond`;
  return request.post(option);
};

export const upPopularHistory = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/red/upPopularHistory`;
  return request.get(option);
};

export const getServiceImId = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/getServiceImId`;
  return request.get(option);
};



export const userPartnerInfo = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/userPartnerInfo`;
  return request.get(option);
};

export const partnerRechargeConfig = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/partnerRechargeConfig`;
  return request.get(option);
};



export const rechargeVip = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/housekeeper/rechargeVip`;
  return request.post(option);
};

// 搜索用户列表
export const searchUserByNameOrPhone = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/searchUserByNameOrPhone`;
  return request.get(option);
};

// 添加好友
export const addFriend = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/addFriend`;
  return request.post(option);
};



export const getNewsById = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/getNewsById`;
  return request.get(option);
};
// IM好友列表
export const pageUserFriendList = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/pageUserFriendList`;
  return request.get(option);
};


export const scanTrendsAddScore = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/user/scanTrendsAddScore`;
  return request.get(option);
};
export const userAuthentication = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/store/userAuthentication`;
  return request.get(option);
};
export const queryHomePageInfo = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/publish/queryHomePageInfo`;
  return request.post(option);
};

export const queryUpdateVersion = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/version/queryUpdateVersion`;
  return request.get(option);
};
export const getDefaultSecureInfo = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/secure/getDefaultSecureInfo`;
  return request.post(option);
};
export const setOrderSecure = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/secure/setOrderSecure`;
  return request.post(option);
};
export const cancelSecureMsg = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/secure/cancelSecureMsg`;
  return request.post(option);
};
export const dleSecureMsg = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/order/secure/dleSecureMsg`;
  return request.post(option);
};
export const activityListFreeMsg = (
  option: MyRequestOptions = {}
): Promise<HttpResponse> => {
  option.url = `/app/activity/listFreeMsg`;
  return request.get(option);
};
